package cn.sunline.client;

import cn.hutool.json.JSONUtil;
import cn.sunline.framework.le.IcenInfo;
import cn.sunline.framework.le.ck.IcenUtil;

import java.io.File;

public class CheckLicense {
    public static void main(String[] args) throws Exception {
        if (args.length != 1){
            printUsage();
            System.exit(255);
        }

        String dirPath = args[0];

        IcenInfo icenInfo= IcenUtil.check(new File(dirPath));

        System.out.println(JSONUtil.parse(icenInfo).toJSONString(1));
    }



    public static void  printUsage(){
        System.out.println("参数不正确");
        System.out.println("使用方法:");
        System.out.println("java -jar CheckLicense.jar <license存放的路径>:");
        System.out.println("示例:");
        System.out.println("java -jar CheckLicense.jar /app/conf/");
    }



}
